Post

Replies

Boosts

Views

Activity

Reply to SwiftUI 6 AttributeGraph warnings in console
Well, as you have properly guessed, this tiny code has only the benefit of showing the issue. In my app, I'm actually working with a function that can take up to 1-2 seconds max. The thing is that when I remove only the modifier .disabled(...), this issue vanishes. Before posting this topic, I tried many things and when I finally got this tiny reproducible issue code, I then tried to work with DispatchQueue.main.async {...} to avoid the trap my code was driving me on. My View is build like this: private var isLoading: Bool { !isInitialized || isWorking } var body: some View { ZStack { VStack { Grid { GridRow { ... Button { Task { await requestPermission() } } label: { ... } } GridRow { ... } } } .disabled(isLoading) .... if isLoading { ProgressView() } } } where isInitialized is handled in the parent and isWorking is handled locally like this: private func requestPermission() async { isWorking = true defer { isWorking = false } ... } But as far as the tiny code is able to reproduce the warnings, and most importantly as I'm still learning about Swift, I need support from stronger skills than mine.
Topic: UI Frameworks SubTopic: SwiftUI
Jun ’26
Reply to SwiftUI 6 AttributeGraph warnings in console
This thread can be closed: I just upgraded my MacBook Air to Tahoe 26.5.2 to benefit from the last Xcode 26.6, and I retest my application (not the tiny code): there is no more warnings. Thank you to the whole team of Apple who definitely never stop improving everything!
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Jul ’26
Reply to SwiftUI 6 AttributeGraph warnings in console
Interesting info: if I add one object such as another Button and if this second Button has the focus, warnings aren't printed.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Jun ’26
Reply to SwiftUI 6 AttributeGraph warnings in console
Well, as you have properly guessed, this tiny code has only the benefit of showing the issue. In my app, I'm actually working with a function that can take up to 1-2 seconds max. The thing is that when I remove only the modifier .disabled(...), this issue vanishes. Before posting this topic, I tried many things and when I finally got this tiny reproducible issue code, I then tried to work with DispatchQueue.main.async {...} to avoid the trap my code was driving me on. My View is build like this: private var isLoading: Bool { !isInitialized || isWorking } var body: some View { ZStack { VStack { Grid { GridRow { ... Button { Task { await requestPermission() } } label: { ... } } GridRow { ... } } } .disabled(isLoading) .... if isLoading { ProgressView() } } } where isInitialized is handled in the parent and isWorking is handled locally like this: private func requestPermission() async { isWorking = true defer { isWorking = false } ... } But as far as the tiny code is able to reproduce the warnings, and most importantly as I'm still learning about Swift, I need support from stronger skills than mine.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Jun ’26
Reply to How to style SwiftUI MacOS TabView?
Here is what I did: https://stackoverflow.com/a/78754366/7991036. Hope this will help you.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’24